package com.cheng.example.exception;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class IoExceptionDemo {

    public static void main(String[] args) throws FileNotFoundException, InterruptedException {
        FileReader fileReader = new FileReader("E:\\测试.txt");
        Thread.sleep(10000);
        BufferedReader bufferedReader = new BufferedReader(fileReader);
//        try {
//            String line = bufferedReader.readLine();
//            System.out.println(line);
//        } catch (IOException e) {
//            System.out.println("Catch a IOException...");
//            e.printStackTrace();
//        }


        try {
            String line = bufferedReader.readLine();
            System.out.println(line);
        } catch (IOException e) {
            System.out.println("Catch a IOException...");
            e.printStackTrace();
        }
    }

}